package com.blog.cloud.controller;

import com.blog.cloud.service.ProducerService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("/rocket")
public class ProducerController {

    private final ProducerService producerService;

    @GetMapping("/asyncSend/{message}")
    public void asyncSend (@PathVariable("message") String message) {
        producerService.asyncSend(message);
    }

    @GetMapping("/convertAndSend/{message}")
    public void convertAndSend (@PathVariable("message") String message) {
        producerService.convertAndSend(message);
    }

    @GetMapping("/send/{message}")
    public void send (@PathVariable("message") String message) {
        producerService.send(message);
    }
}
